package mapper;

import model.Drug;
import model.DrugBatch;
import model.vo.PrescriptionDrugVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DrugBatchMapper {

    @Select("select * from drug_batch where drug_id=#{id}")
    List<DrugBatch> findAll(int id);

    @Update("update drug_batch set residue_stock = residue_stock-#{amount} where id = #{bid}")
    int updateResidueStock(PrescriptionDrugVo vo);
}
